﻿// -----------------------------------------------------------------------
// This class represents an exception when the state invariant of a 
// class is violated.
//
// Author: Dan Buvid
// Date: April 13, 2012
// -----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ResidencyPlacement
{
    public class InvariantException : Exception
    {
        /// <summary>
        /// Customized constructor.
        /// </summary>
        /// <param name="className">The name of the class from which the exception is thrown.</param>
        /// <param name="method">The name of the method from which the exception is thrown.</param>
        /// <param name="message">A string that represents whether the state invariant is violated 
        /// before the operation is invoked or after the operation is invoked.</param>
        public InvariantException(string className, string method, string beforeOrAfter)
        {
            Console.WriteLine("State Invariant violated {0} {1} in {2}", beforeOrAfter, method, className);
        }
    }
}
